package top.codecrab.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import top.codecrab.springcloud.client.PaymentFeignClient;
import top.codecrab.springcloud.entity.response.Result;

import javax.annotation.Resource;

/**
 * @author codecrab
 * @since 2021年05月17日 10:38
 */
@RestController
public class PaymentFeignController {

    @Resource
    private PaymentFeignClient paymentFeignClient;

    @GetMapping(value = "/consumer/payment/get/{id}")
    public Result getPaymentById(@PathVariable("id") Long id) {
        return paymentFeignClient.getById(id);
    }

    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut() {
        return paymentFeignClient.paymentFeignTimeOut();
    }
}
